<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>定义与使用一个名为button-counter的组件</title>
	<script src="vue.js"></script>
  <link rel="stylesheet" href="global.css" />
</head>
<body>
<div id="app">
  <button-counter></button-counter>
</div>
<script>
  // 定义一个名为button-counter的组件
  Vue.component('button-counter', {
    data: function () {
      return {
        count: 0
      }
    },
    template: '<button v-on:click="count++">单击了{{ count }} 次</button>'
  })	
  // 创建根实例
  var vm=new Vue({
     el: '#app'
  })
</script>
</body>
</html>
